package mobi.hami.huapin.service.impl;

import mobi.hami.huapin.dao.UserShareLogMapper;
import mobi.hami.huapin.model.UserShareLog;
import mobi.hami.huapin.service.UserShareLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create by 小峰 on 2018/9/13.
 * 用户分享记录
 */
@Service
public class UserShareLogServiceImpl implements UserShareLogService {

    @Autowired
    private UserShareLogMapper userShareLogMapper;

    public UserShareLog FindOneByPrimaryKey(Integer id)
    {
      return  userShareLogMapper.selectByPrimaryKey(id);
    }

    public Integer updateModel(UserShareLog userShareLog){
        return  userShareLogMapper.updateByPrimaryKeySelective(userShareLog);
    }

    /**
     * 保存分享记录
     * @param userShareLog
     * @return
     */
    public Integer saveUserShareLog(UserShareLog userShareLog){
        userShareLogMapper.insertSelective(userShareLog);
        return  userShareLog.getId();
    }
}
